package com.ibm.cps.message.validation;

import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ibm.cps.message.MessageFields;
import com.ibm.util.exception.CPSException;

public class RuleProcessorValidator extends IProcessorValidator {

	@Override
	public void validatePostMessage(ObjectNode element) throws CPSException {
		ValidatorUtil.assignRandomIdIfNotPresent(element,
				MessageFields.PROCESSORID);

		String[] strFields = { MessageFields.RULENAME, MessageFields.RULE,
				MessageFields.PARENTPROCESSORS };
		String[] intFields = { MessageFields.MODEL };
		ValidatorUtil.validateAllTypeFields(element, strFields, null, null,
				intFields);
	}

}
